* OSGi service definitions

This repository defines OSGi services I have found useful, and where I have defined similar services in more than once project.

There are no applications in this project, only service definitions.

The service definitions have been deployed to maven central.

** Status of the project

[[https://github.com/steinarb/osgi-service/actions/workflows/osgi-service-maven-ci-build.yml][file:https://github.com/steinarb/osgi-service/actions/workflows/osgi-service-maven-ci-build.yml/badge.svg]]
[[https://coveralls.io/github/steinarb/osgi-service][file:https://coveralls.io/repos/github/steinarb/osgi-service/badge.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=alert_status#.svg]]
[[https://maven-badges.herokuapp.com/maven-central/no.priv.bang.osgiservice/osgiservice][file:https://maven-badges.herokuapp.com/maven-central/no.priv.bang.osgiservice/osgiservice/badge.svg]]
[[https://www.javadoc.io/doc/no.priv.bang.osgiservice/osgiservice][file:https://www.javadoc.io/badge/no.priv.bang.osgiservice/osgiservice.svg]]

[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/images/project_badges/sonarcloud-white.svg]]

[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=sqale_index#.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=coverage#.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=ncloc#.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=code_smells#.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=sqale_rating#.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=security_rating#.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=bugs#.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=vulnerabilities#.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=duplicated_lines_density#.svg]]
[[https://sonarcloud.io/summary/new_code?id=steinarb_osgi-service][file:https://sonarcloud.io/api/project_badges/measure?project=steinarb_osgi-service&metric=reliability_rating#.svg]]

** Services defined in this project
*** no.priv.bang.osgiservice.users.UserManagementService

The [[https://static.javadoc.io/no.priv.bang.osgiservice/osgiservice/1.1.0/no/priv/bang/osgiservice/users/UserManagementService.html][UserManagementService]] provides access to management of users, roles and permissions.

To compile code using this OSGi service, add the following dependency to your maven POM:
#+BEGIN_SRC xml
  <dependency>
      <groupId>no.priv.bang.osgiservice</groupId>
      <artifactId>osgiservice.users</artifactId>
      <version>2.0.1</version>
      <scope>provided</scope>
  </dependency>
#+END_SRC

To get runtime access to this OSGi service in apache karaf, add the following to the karaf feature definition of the OSGi bundle(s) using the interface:
#+BEGIN_SRC xml
  <repository>mvn:no.priv.bang.osgiservice/osgiservice/2.0.1/xml/features</repository>
  <feature name="myfeature">
      <feature>sb-database-osgi-service</feature>
  </feature>
#+END_SRC

Alternatively, when using the [[https://svn.apache.org/repos/asf/karaf/site/production/manual/latest/karaf-maven-plugin.html][karaf-maven-plugin]] it's possible to add a karaf runtime feature dependency when generating a feature for your own bundle:
#+BEGIN_SRC xml
  <dependency>
      <groupId>no.priv.bang.osgiservice</groupId>
      <artifactId>osgiservice.users</artifactId>
      <version>2.0.1</version>
      <type>xml</type>
      <classifier>features</classifier>
  </dependency>
#+END_SRC

** Release history

| Version | Date         | Description                                                                                                            |
|---------+--------------+------------------------------------------------------------------------------------------------------------------------|
|   2.0.1 | [2025-02-12] | Add operations to handle unlocking of users, built with karaf 4.4.7                                                    |
|   2.0.0 | [2024-05-26] | Replace immutable beans with records, remove the unused DatabaseService                                                |
|   1.8.0 | [2022-05-31] | Built with karaf 4.4.0 and OSGi 8, use immutable beans 1.2.0                                                           |
|   1.7.3 | [2021-06-10] | Stop dependencyManagemen from the parent leaking into the BoM                                                          |
|   1.7.2 | [2021-04-18] | Add a "Bill of Materials" (BoM)                                                                                        |
|   1.7.1 | [2021-04-15] | Get maven dependencies and maven plugin config from a parent POM                                                       |
|   1.7.0 | [2021-04-12] | Built with karaf 4.3.0 and OSGi 7                                                                                      |
|   1.6.1 | [2021-03-13] | Fixes to the UserManagementService bean builders. Should have tested better before releasing                           |
|   1.6.0 | [2021-03-10] | Use builders to create the beans used in the UserManagementService interface                                           |
|   1.5.0 | [2019-12-31] | Let Immutable provide hashCode() and equals() implementation to user management beans                                  |
|   1.4.0 | [2019-10-27] | Add abstract class DatabaseServiceBase implementing getConnection() and method for creating JDBC connection properties |
|   1.3.0 | [2019-10-14] | Update plugins and dependencies and fix [[https://github.com/steinarb/osgi-service/issues/1][issue #1]]                                                                       |
|   1.2.0 | [2019-03-30] | Add methods to UserManagementService                                                                                   |
|   1.1.0 | [2019-02-17] | Working javadoc, first version of the UserManagementService                                                            |
|   1.0.0 | [2018-12-19] | First version of the DatabaseService                                                                                   |
** License

This code is licensed under the Apache license v. 2.  See the LICENSE file for details.
